<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/html/js/axios.min.js"></script>
    <script src="/html/js/ajax.js"></script>
    <script src="/html/js/util.js"></script>
    <script>
        async function add(){
            let info=await uploadAjaxPost("/user/add",{
               name:getObject("userName").value,
                face:getObject("face").files[0]
            });
        }
    </script>
</head>
<body>
<!--    <form action="/user/add" method="post" enctype="multipart/form-data">-->
<!--        姓名:<input type="text" name="userName"><br>-->
<!--        <img src="" id="faceImg" width="200" height="200"><br>-->
<!--        头像:<input type="file" name="face" id="face" onchange="fileChange('face','faceImg')"><br>-->
<!--        <input type="submit" value="提交">-->
<!--    </form>-->
    <hr>
        姓名:<input type="text" name="userName" id="userName"><br>
        <img src="" id="faceImg" width="200" height="200"><br>
        头像:<input type="file" name="face" id="face" onchange="fileChange('face','faceImg')"><br>
        <input type="button" value="添加" onclick="add()">
</body>
</html>